<template>
	<view>
		<view style="padding: 30rpx;">
			<view style="border-bottom: 1px solid #dddddd;padding: 25rpx;">
				<uni-row>
					<uni-col :span="6">
						<b>持卡人</b>
					</uni-col>
					<uni-col :span="18">
						<input v-model="name" focus placeholder="请输入持卡人姓名"  />
					</uni-col>
					
				</uni-row>
			</view>
			<view style="border-bottom: 1px solid #dddddd;padding: 25rpx;">
				<uni-row>
					<uni-col :span="6">
						<b>银行</b>
					</uni-col>
					<uni-col :span="18">
						<input v-model="bankName"  placeholder="请输入银行名称" />
					</uni-col>
				</uni-row>
			</view>
			<view style="border-bottom: 1px solid #dddddd;padding: 25rpx;">
				<uni-row>
					<uni-col :span="6">
						<b>储蓄卡号</b>
					</uni-col>
					<uni-col :span="18">
						<input v-model="cardNo" placeholder="请输入储蓄卡号" />
					</uni-col>
					
				</uni-row>
			</view>
			<view style="border-bottom: 1px solid #dddddd;padding: 25rpx;">
				<uni-row>
					<uni-col :span="6">
						<b>手机号</b>
					</uni-col>
					<uni-col :span="18">
						<input v-model="phone" placeholder="请输入开户时预留的手机号" />
					</uni-col>
				</uni-row>
			</view>
			
		</view>
		<view style="text-align: center; margin-top: 20rpx;">
			<button type="primary" size="mini" style="width: 80%;" @click="submitCard">
				提交银行卡信息
			</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name:"",
				bankName:"",
				cardNo:"",
				phone:""
			}
		},
		methods: {
			submitCard(){
				uni.request({
					url: 'http://120.46.197.40:8080/api/userAccount/insertUserCardInfo',
					method: 'POST',
					data: {
						"bankName": this.bankName,
						"cardNo": this.cardNo,
						"name": this.name,
						"phone": this.phone,
						"isDefault":"0",
						"sort":"2",
						"userId":this.userId
					},
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: (res) => {
						if(res.data.code==0){
							uni.navigateTo({
								url:"/pages/home/wallet/card"
							})
						}
					}
				});
			}
		}
	}
</script>

<style>

</style>
